<?php

namespace Hilaoyu\LaravelExtend\Services\Assents;

use Closure;
use Illuminate\Http\Request;



class AssentsExcludeRouteMiddleware
{

    public function handle(Request $request, Closure $next)
    {
        $session = $request->session();
        $response = $next($request);
        if($session){
            $session->setPreviousUrl(url()->previous());
            $session->save();
        }

        return $response;
    }
}
